package com.bo.threadState;

/**
 * @Author: gpb
 * @Date: 2024/7/13 22:33
 * @Description:
 */
public class BLOCKED {
    public static void main(String[] args) throws InterruptedException {
        Object lock = new Object();
        Thread thread = new Thread(() -> {
            // 线程拿不到锁就是阻塞状态BLOCKED
            synchronized (lock) {

            }
        });
        synchronized (lock){
            thread.start();
            Thread.sleep(500);
            System.out.println(thread.getState());
        }
    }
}
